package gui.product;

import gui.common.*;
import gui.inventory.ProductContainerData;
import gui.main.GUI;


@SuppressWarnings("serial")
public class AddProductView extends ProductView implements IAddProductView {
	//added the ProductContainerData to this call
	public AddProductView(GUI parent, DialogBox dialog, String barcode, 
								ProductContainerData target, int count) {
		super(parent, dialog);
		
		construct();		
		//added the ProductContainerData to this call
		_controller = new AddProductController(this, barcode,target,count);
	}

	@Override
	public IAddProductController getController() {
		return (IAddProductController)super.getController();
	}

	@Override
	protected void valuesChanged() {
		getController().valuesChanged();
	}

	@Override
	protected boolean cancel() {
		AddProductController tmp_controller = (AddProductController) getController();
		
		return tmp_controller.cancel();
	}

	@Override
	protected void ok() {
		getController().addProduct();
	}

}


